package com.tjsinfo.tjsoa.system.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.json.JSONObject;

import com.tjsinfo.tjsoa.system.bo.ISystemPostBO;
/**
 * 岗位禁用
 * @author 岳晓磊
 *
 */
public class PostEnable extends Action {
	private ISystemPostBO systemPostBo; 
	public void setSystemPostBo(ISystemPostBO systemPostBo) {
		this.systemPostBo = systemPostBo;
	}
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		String id = request.getParameter("id");
	    if (systemPostBo.intoSystemPost(id)) {
	    	JSONObject object = new JSONObject();
	    	object.put("success", true);
			response.getWriter().print(object);
		} else {
			JSONObject object = new JSONObject();
	    	object.put("success", false);
			response.getWriter().print(object);
		}
		
		return null;
	}
}
